package com.iamk.util;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class GetLabel {
	public static ArrayList<String[]> readLabelFile(String path) {
		ArrayList<String[]> results = new ArrayList<String[]>();
		try {
			// Open the file that is the first
			FileInputStream fstream = new FileInputStream(path);

			// Use DataInputStream to read binary NOT text.
			InputStreamReader in = new InputStreamReader(fstream);
			BufferedReader br = new BufferedReader(in);

			String strLine;
			// Read File Line By Line
			String[] numbers;
			while ((strLine = br.readLine()) != null) {
				numbers = new String[3];
				// Add number from file to list
				String[] arrRow = strLine.split(",");
				for (int i = 0; i < arrRow.length; i++) {
					numbers[i] = (arrRow[i]);
//					System.out.println(numbers[i]);
				}
				results.add(numbers);
			}
			// Close the input stream
			// System.out.println(saleNumbers);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return results;
	}

	// public static void main(String[] args) {
	// for (int[] i:
	// readLabelFile("C:\\Users\\sev_user\\Desktop\\Data\\Data\\labels.txt")) {
	// System.out.println(i[2]);
	//
	// }
	// }
}
